package learn.ch1;

import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
import java.util.Arrays;

/**
 * @Description main
 * @Author yusj
 * @Date 2021/12/11
 * @Version 1.0
 */
public class JustMain {
    public static void main(String[] args){
        ThreadMXBean  threadMXBean = ManagementFactory.getThreadMXBean();
        Arrays.stream(threadMXBean.dumpAllThreads(false, false))
                .forEach(threadInfo -> {
                    System.out.println("["+threadInfo.getThreadId()+"] "+threadInfo.getThreadName());
                });
    }
}
